package org.itboys.mobile.util;


import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mobile.dto.report.SundayReportProductDto;

import java.util.*;

public class TestList {
    private Integer age;
    private Integer money;

    public TestList() {
    }

    public TestList(Integer age, Integer money) {
        this.age = age;
        this.money = money;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public static void main(String[] args) {
        List<TestList> results = new ArrayList<>();
        results.add(new TestList(1,10));
        results.add(new TestList(4,40));
        results.add(new TestList(3,30));
        Collections.sort(results, new Comparator<TestList>() {
            @Override
            public int compare(TestList o1, TestList o2) {
                int i = o1.getAge() - o2.getAge();
                return i;
            }
        });
        for(TestList result:results){
            System.out.println("年龄="+result.getAge()+",钱="+result.getMoney());
        }
        System.out.println("------愉快的分割线------------------");
        Collections.sort(results, new Comparator<TestList>() {
            @Override
            public int compare(TestList o1, TestList o2) {
                int i = o2.getAge() - o1.getAge();
                return i;
            }
        });
        for(TestList result:results){
            System.out.println("年龄="+result.getAge()+",钱="+result.getMoney());
        }
       /* Double a=1.59;
        int b=746;
        String c = String.valueOf(Double.valueOf(b)/a);
        c=c.substring(0,c.indexOf("."));
       // System.out.print(Integer.valueOf(c));



        Date now=new Date();
        System.out.println(TimeUtils.format(now,"yyyy-MM-dd"));
        now.setDate(now.getDate()+20);
        System.out.println(TimeUtils.format(now,"yyyy-MM-dd"));
        for(int i=0;i<5;i++){

        }*/

       // System.out.print(Integer.valueOf(String.valueOf(Double.valueOf(b)/a)));
	}
}

